<!--
 * Copyright TLR Team, Inc. All Rights Reserved.
-->
<ng-include src="'app/mvp/template/view/form/rename.html'"></ng-include>
<ng-include src="'app/mvp/template/view/form/wifi.html'"></ng-include>
<div class="measure-bg">
    <div class="container-fluid">
        <!-- /.row -->
        <div class="row">
            <div class="device-item-title item-font title-bg">
                <div class="device-title-txt">空气测量仪</div>
                <div class="right-triangle"></div>
                <div style="float:right;" class="device-title-txt"><a href="#/air-measure-bind">绑定</a></div>
            </div>
        </div>
        <div clas="row" ng-if="!airDevices">
            <div class="loading">
                <span></span>
                <span></span>
                <span></span>
                <span></span>
                <span></span>
            </div>
        </div>
        <div class="row" ng-if="airDevices.length === 0">
            <div class="col-sm-12 device-item-container">
                <div class="device-item background">
                    <div class="device-item-txt" style="padding-top:20px;text-align:center;">
                        无绑定设备
                    </div>
                </div>
            </div>
        </div>
        <div class="row" ng-repeat="device in airDevices track by $index">
            <div class="col-sm-12 device-item-container">
                <div class="device-item background" ng-class="{'device-item-active': airDeviceIndex === $index}">
                    <div ng-long-press="onLongPress" ng-long-press-index="{{$index}}" class="device-item-alias air-measure-title">
                        <span class="item-font">{{device.nick_name}}<span class="tlr-unit">(PM2.5 μg/m3)</span></span><br>
                        <span class="item-font item-small-font">长按3秒修改</span>
                    </div>
                    <div ng-click="deviceClick(device.device_mac, $index);" class="device-item-txt" style="padding-top:0px;text-align: center; margin-left:0;margin-bottom:0px;">
                        <div style="max-height:55px;min-width:103px;display:inline-block;border-bottom: 3px solid {{getColorOfPM25(device.pm25_measure)}};">
                            <div style="float:left;display:block;padding-top:2px;"><span class="device-item-value ng-binding">{{device.pm25_measure}}</span></div>
                            <div style="float:right;display:block;margin-top:32px;padding-left:8px;"><span class="device-item-label">室内</span></div>
                        </div>
                    </div>
                    <div ng-click="deviceClick(device.device_mac, $index);" class="device-item-txt" style="padding-top:0px;text-align: center; margin-left:0;margin-top:0px;">
                        <div style="max-height:55px;min-width:103px;display:inline-block;border-bottom: 3px solid {{getColorOfPM25(device.pm25_outdoor)}};">
                            <div style="float:left;display:block;padding-top:2px;"><span class="device-item-value ng-binding">{{device.pm25_outdoor}}</span></div>
                            <div style="float:right;display:block;margin-top:32px;padding-left:8px;"><span class="device-item-label">室外</span></div>
                        </div>
                    </div>
                    <div id="air-device-menu-id-{{$index}}" style="display:none;" class="tlr-menu-top-border">
                        <div class="row">
                            <div class="col-xs-6 device-menu-item" 
                                 style="padding-left:30px;padding-right:20px;border-right: 1px solid #C2C0C0;">
                                <div class="item-txt tlr-menu-bottom-border">
                                    <a href="#/air-measure-history?mac={{currentMac}}&action=hour_history&data_type=PM2.5">
                                        <div style="margin-top:0px;">
                                            <div class="tlr-icon2-day"></div>
                                            <div style="padding-top:6px;padding-bottom:8px;">24小时历史</div>
                                        </div>
                                    </a>
                                </div>
                            </div>
                            <div class="col-xs-6 device-menu-item" style="padding-right:30px">
                                <div class="item-txt tlr-menu-bottom-border">
                                    <a href="#/air-measure-history?mac={{currentMac}}&action=day_history&data_type=PM2.5">
                                        <div style="margin-top:0px;">
                                            <div class="tlr-icon2-history"></div>
                                            <div style="padding-top:6px;padding-bottom:8px;">30天历史</div>
                                        </div>
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-6 device-menu-item" 
                                 style="padding-left:30px;padding-right:20px;border-right: 1px solid #C2C0C0;">
                                <div class="item-txt" ng-click="onConfigWiFi()">
                                    <div style="margin-top:0px;">
                                        <img class="air-btn" src="app/images/purifier/wifi-1.png"></img>
                                        <div style="padding-top:6px;padding-bottom:8px;">WIFI</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- /.row -->
    </div>
</div>